#include-once

If $ethertype="0x0800" Then ;IPv4
		Local $src=Number(BinaryMid ($data, 27 ,1))&"."&Number(BinaryMid ($data, 28 ,1))&"."&Number(BinaryMid ($data, 29 ,1))&"."&Number(BinaryMid ($data, 30 ,1))
		Local $dst=Number(BinaryMid ($data, 31 ,1))&"."&Number(BinaryMid ($data, 32 ,1))&"."&Number(BinaryMid ($data, 33 ,1))&"."&Number(BinaryMid ($data, 34 ,1))
		Switch BinaryMid ($data, 24 ,1)
			Case "0x01"
			   $return[0] = "ICMP " & $src & " -> " & $dst
			   $return[1] = Data_Decrypt($data,25)
			   $return[2] = Data_Binary($data,25)

			   Return $return
			Case "0x02"
			   $return[0] = "IGMP " & $src & " -> " & $dst
			   $return[1] = Data_Decrypt($data,25)
			   $return[2] = Data_Binary($data,25)

			   Return $return
			Case "0x06"
				Local $srcport=Number(BinaryMid ($data, 35 ,1))*256+Number(BinaryMid ($data, 36 ,1))
				Local $dstport=Number(BinaryMid ($data, 37 ,1))*256+Number(BinaryMid ($data, 38 ,1))
				Local $flags=BinaryMid ($data, 48 ,1)
				Local $f=""

				If BitAND($flags,0x01) Then $f="Fin "
				If BitAND($flags,0x02) Then $f&="Syn "
				If BitAND($flags,0x04) Then $f&="Rst "
				If BitAND($flags,0x08) Then $f&="Psh "
				If BitAND($flags,0x10) Then $f&="Ack "
				If BitAND($flags,0x20) Then $f&="Urg "
				If BitAND($flags,0x40) Then $f&="Ecn "
				If BitAND($flags,0x80) Then $f&="Cwr "
				$f=StringTrimRight(StringReplace($f," ",","),1)
				$return[0] = "TCP(" & $f & ") " & $src & ":" & $srcport & " -> " & $dst & ":" & $dstport
				$return[1] = Data_Decrypt($data,55)
				$return[2] = Data_Binary($data,55)

				Return $return
			Case "0x11"
				Local $srcport=Number(BinaryMid ($data, 35 ,1))*256+Number(BinaryMid ($data, 36 ,1))
				Local $dstport=Number(BinaryMid ($data, 37 ,1))*256+Number(BinaryMid ($data, 38 ,1))
				$return[0] = "UDP " & $src & ":" & $srcport & " -> " & $dst & ":" & $dstport
				$return[1] = Data_Decrypt($data,39)
				$return[2] = Data_Binary($data,39)

				Return $return
			Case Else
				$return[0] = "IP " & BinaryMid($data, 24 ,1) & " " & $src& " -> " & $dst
				$return[1] = Data_Decrypt($data,25)
				$return[2] = Data_Binary($data,25)

				Return $return
		EndSwitch
		$return[0] = BinaryMid( $data, 13 ,2 ) & " " & $src & " -> " & $dst
		$return[1] = Data_Decrypt($data,15)
		$return[2] = Data_Binary($data,15)

		Return $return
EndIf